@import '../fonts.less';
@import '../variables.less';
@import '../includes/mixins.less';
@import 'mixins.less';

.fonts('../../fonts');

html, body {
  font-size: 15px;
  height: 100%;
}

a {
  color: @mobileHyperlink;
  text-decoration: none;
}

a:hover {
  text-decoration: hover;
}

sup sup,
sub sub,
small small {
  bottom: 0;
  font-size: 100%;
  position: relative;
  top: 0;
  vertical-align: baseline;
}

body {
  font-family: @Moz;
  overflow-x: hidden;
  width: 100%;

  > * {
    transform: translateZ(0px);
  }

  > nav {
    background: #000;
    color: #fff;
    display: none;
    height: 100%;
    left: 0;
    overflow: auto;
    position: fixed;
    top: 0;
    width: 270px;
    z-index: 0;

    > a,
    > a:visited,
    > a:hover {
      color: #fff;
      display: block;
      font-size: 17px;
      padding: 16px 16px 10px 16px;
      text-decoration: none;
    }

    > header {
      margin-top: 30px;
      font-size: 14px;
      font-weight: normal;
      padding: 0 16px 4px 0;
      margin-left: 16px;
      opacity: 0.8;
      border-bottom: 1px solid rgba(255,255,255,0.4);
    }

    #search-bar {
      background: #000;
      box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.75);
      padding: 8px;

      form {
        display: block;
        position: relative;
        padding: 0;

        button[type='submit'] {
          background-color: transparent;
          background-position: -54px -177px;
          border: 0;
          height: 18px;
          margin: 0;
          outline: 0;
          padding: 0;
          position: absolute;
          right: 6px;
          text-indent: -9999px;
          top: 9px;
          width: 18px;
        }

        input[type='search'] {
          background: rgba(255, 255, 255, 0.1);
          border: 1px solid rgba(255, 255, 255, 0.2);
          border-radius: 3px;
          box-sizing: border-box;
          color: #fff;
          font-family: @Moz;
          font-size: 14px;
          outline: none;
          padding: 10px 30px 10px 10px;
          width: 100%;
        }
      }
    }
  }

  &.exposed {
    > nav {
      display: block;
    }

    .slide-on-exposed {
      left: 270px;
    }
  }

  .slide-on-exposed {
    left: 0;
    transition-property: left, right;
    transition-duration: 0.5s;
  }

  > header {
    background: #000;
    color: #fff;
    height: 50px;
    overflow: hidden;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10;

    h1 {
      font-size: 18px;
      font-weight: normal;
      height: 50px;
      line-height: 50px;
      margin: 0 16px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #instant-search-form {
      display: none;
      position: relative;

      &:after {
        color: #000;
        content: '\f002'; // Search icon
        font-family: 'FontAwesome';
        left: 24px;
        line-height: 24px;
        position: absolute;
        top: 13px;
        z-index: 1;
      }

      input[type=search] {
        border: 0;
        box-sizing: border-box;
        box-shadow: none;
        color: #000;
        height: 24px;
        font-size: 14px;
        outline: none;
        margin: 13px;
        padding: 4px 10px 4px 34px;
        width: calc(~'100% - 140px');
      }
    }

    &.searching {
      #instant-search-form {
        display: block;
      }

      #header-components {
        display: none;
      }
    }
  }

  > .wrapper {
    background: #fff;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.8);
    min-height: calc(~"100% - 51px");
    position: absolute;
    top: 51px;
    width: 100%;
    z-index: 1;
  }

  &.minimal {
    > .wrapper {
      box-shadow: none;
      top: 0;
    }
  }

  &[data-orientation='right'] {
    > nav,
    .slide-on-exposed {
      left: auto;
      right: 0;
    }

    #menu-button {
      border-right: 0;
      float: right;
    }

    #search-button {
      float: right;
      margin-left: 10px;
      margin-right: 0;
    }

    &.exposed {
      .slide-on-exposed {
        right: 270px;
      }
    }
  }
}

fieldset {
  border: 0;
  margin: 0;
  outline: none;
  padding: 0;
}

h3 {
  font-size: 20px;
  font-weight: normal;
}

h4 {
  font-size: 17px;
  font-weight: normal;
}

input[type='text'],
input[type='password'],
input[type='email'],
input[type='url'],
select,
textarea {
  background: #fff;
  border: 1px solid @mobileInputBorder;
  border-radius: 3px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1) inset;
  box-sizing: border-box;
  display: inline-block;
  font-family: @Moz;
  font-size: 14px;
  margin: 0 0 12px 0;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

select {
  -moz-appearance: none;
  -webkit-appearance: none;
  height: 41px;
}

.add-button {
  background-position: -36px -1153px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px @mobileHeaderBorder;
  cursor: pointer;
  float: right;
  height: 24px;
  margin: 0 -9px 0 10px;
  padding: 13px;
  text-indent: -9999px;
  width: 24px;
}

.btn,
.btn:visited,
input[type="submit"],
input[type="submit"]:visited {
  display: block;
  border-radius: @button-radius;
  color: @button-color;
  font-weight: bold;
  font-size: 18px;
  background: @button-primary-bg;
  border: 0 none;
  padding: 10px 30px;
  box-sizing: border-box;
  margin-bottom: 10px;
  text-align: center;
  width: 100%;

  &:hover {
    background: darken(@button-primary-bg, 10%);
    text-decoration: none;
  }

  &:active {
    background: darken(@button-primary-bg, 20%);
    color: @button-color;
  }

  &.btn-submit {
    background: @button-dark-bg;

    &:hover,
    &:active {
      background: @button-dark-bg;
      color: @button-color;
    }
  }
}

.btn:hover {
  text-decoration: none;
}

.centered {
  color: #2BBAE7;
  font-family: "Komikax";
  font-size: 24px;
  text-align: center;
  text-transform: uppercase;
}

.collapsable {
  article {
    display: none;
  }

  .toggle {
    color: @mobileHyperlink;
    cursor: pointer;

    > span {
      &.alt {
        display: none;
      }
    }
  }

  &.expanded {
    article {
      display: block;
    }

    .toggle {
      > span {
        display: none;

        &.alt {
          display: inline;
        }
      }
    }
  }
}

.edit-button {
  background-position: -36px -657px;
  cursor: pointer;
  float: right;
  height: 24px;
  margin: 0 -10px 0 10px;
  padding: 13px;
  text-indent: -9999px;
  width: 24px;
}

.errorlist {
  list-style: none;
  margin: 0 0 12px 0;
  padding: 0;

  li {
    color: @textDarkOrange;
    margin-bottom: 6px;

    a,
    a:visited,
    a:hover {
      color: @textDarkOrange;
      text-decoration: none;
    }
  }
}

.icon-sprite {
  .icons-sprite();
}

.logo-sprite {
  height: auto;
  width: 120px;
}

.header-overlay {
  background: #000;
  border-bottom: 1px solid #000;
  height: 50px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;

  h2 {
    color: #fff;
    font-size: 24px;
    font-weight: normal;
    line-height: 50px;
    margin: 0 16px;
  }

  .done-button {
    color: #fff;
    cursor: pointer;
    float: right;
    height: 50px;
    line-height: 50px;
    padding: 0 12px;
  }
}

.footer-overlay {
  background: #000;
  bottom: 0;
  height: 50px;
  position: fixed;
  width: 100%;
  z-index: 100;
}

.overlay {
  background: rgba(40, 40, 40, 0.98);
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;

  > header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    height: 50px;
    left: 0;
    line-height: 50px;
    padding: 0 30px;
    position: absolute;
    right: 0;
    top: 0;
  }

  .select-list {
    font-size: 24px;
    list-style: none;
    margin: 0 24px;
    padding: 0;

    > li {
      > a,
      > a:visited,
      > a:hover {
        border-bottom: 1px solid #000;
        border-top: 1px solid rgba(255, 255, 255, 0.25);
        color: #fff;
        display: block;
        padding: 16px 28px 16px 6px;
        position: relative;
        text-decoration: none;
      }

      &.selected {
        > a,
        > a:visited,
        > a:hover {
          color: #00a5c5;

          &:before {
            content: '\2713';
            position: absolute;
            right: 0;
          }
        }
      }

      &:first-of-type {
        > a {
          border-top: 0;
        }
      }

      &:last-of-type {
        > a {
          border-bottom: 0;
        }
      }
    }
  }

  .wrapper {
    bottom: 0;
    color: #fff;
    font-size: 24px;
    left: 0;
    overflow: auto;
    position: absolute;
    right: 0;
    top: 51px;

    &.padded {
      padding: 0 24px;
    }

    input {
      color: #000;
    }
  }
}

.paginator {
  list-style: none;
  margin: 0;
  padding: 10px 16px;

  li {
    box-sizing: border-box;
    float: left;
    width: 27.5%;

    &.disabled {
      opacity: 0.5;
    }

    &.page {
      padding: 0 16px;
      width: 45%;

      .select-box {
        float: none;
        margin: 0;
      }
    }

    .btn {
      margin-top: 4px;
    }
  }
}

.progress-bar {
  background: rgba(0, 0, 0, 0.1) url('../../img/grain.png');
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  height: 24px;
  line-height: 24px;
  position: relative;
  text-align: right;
  z-index: 1;

  &:after {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 13px;
    bottom: -2px;
    content: '';
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
  }

  &:before {
    border: 2px solid rgba(0, 0, 0, 0.01);
    border-radius: 12px;
    bottom: 0;
    content: '';
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
  }

  > div {
    background: #ff9500;
    background: linear-gradient(to bottom, #ff9500, #ed7000);
    border-radius: 12px;
    height: 24px;
    position: relative;
    z-index: 5;

    > span {
      margin-right: 10px;
    }
  }
}

.pulldown-menu {
  background: @mobileNavBackground url('../../img/grain.png');
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
  left: 0;
  margin-top: 51px;
  position: absolute;
  width: 100%;
  z-index: 8;

  .pulldown-panel {
    max-height: 0;
    overflow: hidden;
    transition-property: max-height;
    transition-duration: 0.5s;

    > section {
      border-bottom: 1px solid #2f393b;
      border-top: 1px solid #484d54;
      padding: 6px 16px;

      &:first-of-type {
        border-top: 0;
      }

      &:last-of-type {
        border-bottom: 0;
      }
    }
  }

  &.open {
    .pulldown-panel {
      max-height: 800px;
      transition-duration: 1.55s;
    }
  }

  .pulldown-handle {
    background: url('../../img/mobile/handle.png') 0 0 no-repeat;
    bottom: -19px;
    cursor: pointer;
    height: 19px;
    left: 50%;
    margin-left: -42px;
    position: absolute;
    width: 85px;
  }
}

.return-button {
  background-position: -48px -286px;
  border-right: 1px solid @mobileHeaderBorder;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
  float: left;
  height: 24px;
  margin: 0 8px 0 0;
  padding: 13px 4px 13px 2px;
  text-indent: -9999px;
  width: 24px;
}

.scrollable {
  -webkit-overflow-scrolling: touch;
}

.select-box {
  background: #e7e7e7;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  color: #333;
  cursor: pointer;
  float: left;
  height: 38px;
  line-height: 38px;
  overflow: hidden;
  padding: 0 14px;
  position: relative;
  text-decoration: none;

  &:after {
    border-color: transparent #333 transparent transparent;
    border-style: solid;
    border-width: 10px 10px 0 0;
    bottom: 3px;
    content: '';
    position: absolute;
    right: 3px;
  }
}

.smart-width {
  max-width: 100%;
}

.swipeable {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.topic-sprite {
  background: url('../../img/mobile/topics-sprite.png?v=1') -50px -494px no-repeat;
  height: 48px;
  width: 48px;

  &.topic-get-started,
  &.topic-learn-basics-firefox-os {
    background-position: -50px -50px;
  }

  &.topic-download-and-install {
    background-position: -50px -198px;
  }

  &.topic-privacy-and-security {
    background-position: -50px -346px;
  }

  &.topic-customize,
  &.topic-customize-settings {
    background-position: -50px -494px;
  }

  &.topic-fix-problems {
    background-position:  -50px -642px;
  }

  &.topic-get-community-support {
    background-position: -50px -790px;
  }

  &.topic-phone-calls-contacts {
    background-position: -50px -938px;
  }

  &.topic-connect-internet {
    background-position: -50px -1086px;
  }

  &.topic-email-messages {
    background-position: -50px -1234px;
  }

  &.topic-marketplace {
    background-position: -50px -1382px;
  }

  &.topic-multimedia-apps {
    background-position: -50px -1530px;
  }
}

.trash-button {
  background-position: -36px -1400px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px @mobileHeaderBorder;
  cursor: pointer;
  float: right;
  height: 24px;
  margin: 0 -9px 0 10px;
  padding: 13px;
  text-indent: -9999px;
  width: 24px;
}

#cancel-button {
  background-position: -53px -781px;
  border-right: 1px solid @mobileHeaderBorder;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  float: left;
  height: 24px;
  margin: 0 8px 0 0;
  padding: 13px 4px 13px 2px;
  text-indent: -9999px;
  width: 12px;
}

#menu-button {
  background-position: -37px -37px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  float: left;
  height: 24px;
  padding: 13px;
  text-indent: -9999px;
  width: 24px;
}

#search-button {
  cursor: pointer;
  float: left;
  height: 50px;
  line-height: 50px;
  margin-right: 10px;
  position: relative;
  text-align: center;
  width: 50px;
  z-index: 5;

  &:before {
    content: '\f002'; // Search icon
    font-family: FontAwesome;
    font-size: 24px;
  }
}

.searching {
  #search-button {
    &:before {
      content: '\f00d' // Multiplication sign
    }
  }
}

#notifications {
  bottom: 0;
  color: #fff;
  font-family: @Moz;
  font-size: 18px;
  left: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  position: fixed;
  right: 0;

  > li {
    background: #323C3E url("../../img/grain.png");
    padding: 16px;

    &.announcement {
      background: #ffc;
      color: #f90;
      font-size: 14px;
      padding: 12px 16px;
    }
  }
}

#reply-button {
  background-position: -36px -905px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px @mobileHeaderBorder;
  cursor: pointer;
  float: right;
  height: 24px;
  margin: 0 -9px 0 10px;
  padding: 13px;
  text-indent: -9999px;
  width: 24px;
}

#send-button {
  background-position: -35px -1029px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px @mobileHeaderBorder;
  cursor: pointer;
  float: right;
  height: 24px;
  margin: 0 -9px 0 10px;
  padding: 13px;
  text-indent: -9999px;
  width: 24px;
}

.page-not-found {
  background: url(../../img/background-404.jpg) no-repeat;
  background-position: 50% 0;
  border-radius: 5px;
  font-size: 18px;
  line-height: 25px;
  margin: 10px auto;
  max-width: 530px;
  min-height: 500px;
  padding: 10px 0;
  text-align: center;

  h1 {
    color: #fff;
    font-size: 40px;
    font-weight: 100;
    line-height: 55px;
    margin-bottom: 80px;
    text-shadow: #222 1px 1px 2px;
  }

  p, div.search-empty {
    background-color: rgba(256, 256, 256, 0.75);
    padding: 5px;
  }

  form {
    margin: 20px 0px;

    .search-query {
      padding: 5px;
    }
  }
}

.footnote {
  display: block;
  font-size: 12px;
  margin: 10px auto;
  max-width: 530px;
}

@media only screen and (max-width: 319px) {
  body {
    > nav {
      width: calc(~"100% - 50px");
    }

    &.exposed {
      .slide-on-exposed {
        left: calc(~"100% - 50px");
      }
    }

    &[data-orientation='right'] {
      &.exposed {
        .slide-on-exposed {
          left: auto;
          right: calc(~"100% - 50px");
        }
      }
    }
  }
}

@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
  .icon-sprite {
    .icons-sprite-2x();
  }

  .logo-sprite {
    background-size: 148px 1480px;
  }

  .topic-sprite {
    background-image: url('../../img/mobile/topics-sprite-2x.png?v=1');
    background-size: 148px 1628px;
  }

  .pulldown-menu {
    .pulldown-handle {
      background-image: url('../../img/mobile/handle-2x.png');
      background-size: 85px 19px;
    }
  }
}
